<#import "/macro/pmmacro.ftl" as pmmacro >
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="${basepath}/css/pm.css" type="text/css">
<style type="text/css">
body{
	padding:0px;
	margin:0px;
}
#divresult table{
	width: 99%;
	margin-top:20px;
}
#divresult table th,td{
	border: 1px solid #cccccc;
	font-size: 14px;
	font-family: serif;
	text-align :left;
}
</style>
</head>

<body>

<div id="divresult" style="min-height:500px;">
<div>
<table id="duser_table" cellpadding="0" cellspacing="0">
	<thead>
		<tr>
			<td>订单编号</td>
			<td>下单日期</td>
			<td>订单状态</td>
			<td>操作</td>
		</tr>
	</thead>
	<tbody id="duser_tbody">
		<#list pager.result as order>
			<tr>
				<td>${order.orderNo!""}</td>
				<td>
					${order.orderTime?string("yyyy-MM-dd HH:mm:ss")}						
				</td>
				<td>
					${this.obtainStatusStr(order.status)}
				</td>
				<td>
					<a href="javascript: parent.location.href='${basepath}/order/info.htm?orderId=${order.id}';" >查看详情</a>&nbsp;
					<#if order.status == Orderinfo.STATUS_WAIT>
						<a href="javascript: intoProduce(${order.id});" >投入生产</a>&nbsp;
					</#if>
					<#if this.isCanCancel(order.status)>
						<a href="javascript: cancelOrder(${order.id});" >取消生产</a>
					</#if>
					<#if this.isCanRemove(order.status)>
						<a href="javascript: removeOrder(${order.id});" >删除订单</a>
					</#if>
				</td>
			</tr>
		</#list>
	</tbody>
	<tfoot>
		<tr>
			<td colspan="5">
				<@pmmacro.pagetoolv2 formid="orderform"/>
			</td>
		</tr>
	</tfoot>
</table>
</div>
</div>
</body>
<script type="text/javascript" src="${basepath}/js/common_szy.js"></script>
<script type="text/javascript">
(function(){
	window.parent.document.getElementById("resultpage").scrolling='no';
})();
<#--投入生产-->
function intoProduce(orderId){
	getpostform("${basepath}/order/into/produce.htm","post","_parent",{"_method":"put","orderId":orderId});
};
<#--取消订单-->
function cancelOrder(orderId){
	getpostform("${basepath}/order/cancel.htm","post","_parent",{"_method":"put","orderId":orderId});
};
<#--删除订单-->
function removeOrder(orderId){
	getpostform("${basepath}/order/remove.htm","post","_parent",{"_method":"put","orderId":orderId});
};
</script>
</html>